Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 1 - Introducing AppleScript
Chapter 2 - Overview of AppleScript / Expressions


Operations

The following are examples of AppleScript operations and their values. The value of each operation is listed following the comment characters (--).

3 + 4                            --value: 7
(12 > 4) AND (12 = 4)            --value: false
Each operation contains an operator. The plus sign (+) in the first expression, as well as the greater than symbol (>), the equal symbol (=) symbol, and the word AND in the second expression, are operators. Operators transform values or pairs of values into other values. Operators that operate on two values are called binary operators. Operators that operate on a single value are known as unary operators. Chapter 6, "Expressions," contains a complete list of the operators AppleScript supports and the rules for using them.

You can use operations within AppleScript statements, such as:

tell application "Scriptable Text Editor"   delete word 3 + 4 of document "Test"end tell
When you run this script, AppleScript evaluates the expression 3 + 4 and uses the result to determine which word to delete.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996